package com.laber.bbsServices.controller;
import javax.servlet.http.HttpServletRequest;

import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Controller;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.ResponseBody;

import com.laber.bbsServices.dao.BbsUserMapper;
import com.laber.bbsServices.entity.BbsUser;



@Controller
public class TestController {
	@Autowired
	private BbsUserMapper userDao;
	
	@RequestMapping(value = "hello")
	public String hello() {
//		System.err.println("进入");
		return "index";
	}
	
	@RequestMapping(value = "userInfo")
	@ResponseBody
	public BbsUser getUserInfo(HttpServletRequest request){
		BbsUser user = userDao.selectByPrimaryKey(Integer.parseInt(request.getParameter("id")));
//		System.out.println("userName:"+user.getUsername()+"-----passWord:"+user.getPassword());
		return user;
	}
	
}
